<template>
  <div>
    <el-breadcrumb separator="/" style="position: absolute; top: 24px">
      <el-breadcrumb-item v-if="$route.path == '/manageSystemTicketInfo'">
        <span>门票信息</span>
      </el-breadcrumb-item>
      <el-breadcrumb-item v-if="$route.path == '/manageSystemCardInfo'">
        <span>年卡信息</span>
      </el-breadcrumb-item>
      <el-breadcrumb-item v-if="$route.path == '/manageSystemUsers'">
        <span>账号信息</span>
      </el-breadcrumb-item>
      <el-breadcrumb-item v-if="$route.path == '/manageSystemOrders'">
        <span>门票订单信息</span>
      </el-breadcrumb-item>
      <el-breadcrumb-item v-if="$route.path == '/manageSystemCardOrder'">
        <span>年卡订单信息</span>
      </el-breadcrumb-item>
    </el-breadcrumb>
    <el-dropdown class="avatar-container" trigger="click">
      <div class="avatar-wrapper">
        <img src="@/assets/admin.png" class="user-avatar" />
      </div>
      <el-dropdown-menu slot="dropdown" class="user-dropdown">
        <el-dropdown-item @click.native="logout">
          <span style="display: block">退出登录</span>
        </el-dropdown-item>
      </el-dropdown-menu>
    </el-dropdown>
  </div>
</template>

<script>
import { mapState, mapMutations } from "vuex";

export default {
  components: {},
  data() {
    return {};
  },
  computed: {
    ...mapState(["isManageSystem"]),
  },
  created() {},
  mounted() {},
  methods: {
    ...mapMutations(["changeManageSystem"]),
    logout() {
      window.sessionStorage.removeItem("manageSystemUsername");
      this.changeManageSystem(false);
      this.$router.replace("/");
      location.reload();
    },
  },
};
</script>

<style scoped lang="scss">
.avatar-container {
  position: absolute;
  right: 50px;
  top: 10px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  cursor: pointer;
}
</style>
